Skip to content

v5.16.0 proposal#364

Merged
szegedi merged 7 commits into
v5.xfrom
v5.16.0-proposal
Jul 3, 2026
Merged

v5.16.0 proposal#364
szegedi merged 7 commits into
v5.xfrom
v5.16.0-proposal

Conversation

szegedi and others added 3 commits July 2, 2026 17:24
GitHub deprecated the Node.js 20 runtime; bump the actions/* to versions
that run on Node.js 24, matching DataDog/action-prebuildify:
- actions/checkout -> v7
- actions/setup-node -> v6
- actions/download-artifact -> v7 (release.yml)
- the release download-artifact steps now fetch the prebuilds artifact by
  name into ./prebuilds, since v5+ no longer nests a single nameless
  artifact under its own directory
Yarn Berry (Plug'n'Play) prints "YN0007: @datadog/pprof must be built" for
any dependency that declares an install/preinstall/postinstall script, even
the no-op "exit 0". The package ships prebuilt binaries and excludes
binding.gyp from the published tarball, so a consumer has nothing to build;
the script only suppressed npm's implicit node-gyp rebuild in the dev tree,
which CI and the prepare script do explicitly. Removing it stops the
spurious warning for Yarn Berry consumers.

Refs: DataDog/dd-trace-js#5432
…stom-labels (#347)

Port OTEP-4947 thread-context writer from polarsignals/custom-labels

Adds a Node.js writer for the OpenTelemetry Thread Local Context Record
(OTEP-4947), ported from the in-development upstream at
polarsignals/custom-labels (#16, #17).

Native addon (bindings/otel-thread-ctx.cc/.hh): the writer, namespaced
as dd::OtelThreadCtx::Init(exports) and called from binding.cc. The
thread_local discovery symbol otel_thread_ctx_nodejs_v1 stays in
extern "C" at file scope so a reader can find it by name in the
dd_pprof.node dynsym table. Records use a flexible-array tail, are
right-sized to the encoded payload (36-byte attrs_data floor, ×2
growth on append, 612-byte cap), and realloc-on-append updates the
wrapper's record_ pointer in place so every async-context frame holding
the same reference observes the new buffer. binding.gyp adds
-mtls-dialect=gnu2 on x86_64 Linux (TLSDESC; arm64 needs no flag).
Compiles across Node 18–26 (V8 ABI guards) and MSVC.

TS layer (ts/src/otel-thread-ctx.ts), Linux-only with no-op stubs
elsewhere: a ThreadContext class constructed with (traceId, spanId,
attributes?) and re-installed per async-context fire. Instance methods
enter()/run(fn) route through the prototype so only a real
ThreadContext can enter the AsyncLocalStorage; appendAttributes(),
isTruncated(), debugBytes(). Module-level getContext(), clearContext(),
and getProcessContextAttributes(keys) — the frozen OTEP-4719 snapshot
(schema version, uint8-key→name map, V8 layout constants) a reader
needs. Surfaced on the package root as require('@datadog/pprof').
otelThreadCtx.

Tests: a mocha suite (skipped on non-Linux) covering construction,
wire encoding incl. multibyte UTF-8 truncation, the cap and
isTruncated, in-place append vs realloc, async propagation,
enter/run/clearContext lifecycle, getProcessContextAttributes shape,
and a readelf check that the TLS symbol is exported correctly. A
scripts/docker/ harness + `npm run test:docker` runs the full suite in
a Linux container from any host. Verified 158 passing.
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Overall package size

Self size: 2.39 MB
Deduped: 3.09 MB
No deduping: 3.09 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | pprof-format | 2.2.2 | 500.53 kB | 500.53 kB | | source-map | 0.7.6 | 185.63 kB | 185.63 kB | | node-gyp-build | 4.8.4 | 13.86 kB | 13.86 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

…365)

The lint job ran `yarn` with no `yarn.lock` in the repo, so yarn ignored
package-lock.json and resolved every dependency fresh from the
package.json ranges. prettier isn't a direct dependency — it comes in
transitively via gts (^3.6.2) — so CI floated to the newest prettier
(3.9.4), while local development pins 3.8.1 through package-lock.json.

prettier 3.9.x changed how it wraps union return types (collapsing the
leading-`|` multiline form 3.8.1 produces), so `gts check` failed in CI
on heap-profiler.ts / heap-profiler-bindings.ts even though the code was
correctly formatted for the pinned prettier — and the failure never
reproduced locally.

Switch install to `npm ci` (and the script to `npm run lint`) so CI uses
the exact package-lock.json versions the repo is developed against. This
fixes the prettier drift and prevents any future lockless-yarn float for
every other tool in the lint chain.
@szegedi szegedi force-pushed the v5.16.0-proposal branch 2 times, most recently from 18c2345 to 81a5f31 Compare July 2, 2026 16:14
szegedi and others added 3 commits July 2, 2026 18:15
A JS Map always uses the regular OrderedHashMap as its backing table:
V8's Map constructor hardcodes AllocateOrderedHashMap(), and the only
path that could install a SmallOrderedHashMap (OrderedHashMapHandler /
AdjustRepresentation) is test-only, never used by the JSMap/JSSet
builtins. We only ever read AsyncContextFrame (CPED) maps, which are
ordinary JS Maps, so the SmallOrderedHashMap handling was dead code.

Drop the SmallOrderedHashMapLayout struct, IsSmallOrderedHashMap header
sniffing, and the now-unnecessary templating on FindEntryByHash /
FindValueByHash. The public GetValueFromMap signature is unchanged.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The v5.x lockfile carried newer versions than package.json declared —
a desync that lockless `yarn` never validated but `npm ci` (now used by
the lint job) rejects:

- @types/node: package.json 25.9.1 vs lock 25.9.2
- tmp: package.json 0.2.6 vs lock 0.2.7

Align package.json up to the already-locked versions rather than down:
tmp 0.2.6 carries a High-severity advisory (GHSA-7c78-jf6q-g5cm) and the
lock was already advanced to the fixed 0.2.7. This changes nothing about
what gets installed; it only makes the manifest honest. Regenerating the
lockfile also drops the stale root `hasInstallScript` flag (the install
script was removed in #363) and realigns the eslint-plugin-n / semver
range mirrors with package.json.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@szegedi szegedi force-pushed the v5.16.0-proposal branch from 81a5f31 to 0d4e0fb Compare July 2, 2026 16:16
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Jul 2, 2026

Copy link
Copy Markdown

Pipelines

Fix all issues with BitsAI

⚠️ Warnings

🚦 1 Pipeline job failed

DataDog/apm-reliability/pprof-nodejs | benchmarks-pr-comment   View in Datadog   GitLab

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 0d4e0fb | Docs | Datadog PR Page | Give us feedback!

@szegedi szegedi merged commit dff33fb into v5.x Jul 3, 2026
68 of 69 checks passed
@szegedi szegedi deleted the v5.16.0-proposal branch July 3, 2026 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants